function Clicker(){
	var me=this;
	this.mousePressed=new Toggle();
	this.afterClick=undefined;
	this.mousePressed.afterChange=function(){
		if(!me.mousePressed.value()){
			if(me.canvas.value().clickX.value()>me._x.value()
					&& me.canvas.value().clickY.value()>me._y.value()
					&& me.canvas.value().clickX.value()<me._x.value()+me._width.value()
					&& me.canvas.value().clickY.value()<me._y.value()+me._height.value()
				){
				if (me.afterClick!=undefined)me.afterClick();
				}
			}
		};
	this.canvas.afterChange=function(){
		if(me.canvas!=undefined){
			me.mousePressed.bind(me.canvas.value().mousePressed);
			}
		};
	this._width=new Amount().value(32);
	this._height=new Amount().value(32);
	this._x=new Amount().value(0);
	this._y=new Amount().value(0);
	this.click=function(n){
		this.afterClick=n;
		return this;
		};
	this.width=function(n){
		if(n==undefined)return this._width;
		if(n instanceof Amount){
			this._width.bind(n);
			return this;
			}
		this._width.value(n);
		return this;
		};
	this.height=function(n){
		if(n==undefined)return this._height;
		if(n instanceof Amount){
			this._height.bind(n);
			return this;
			}
		this._height.value(n);
		return this;
		};
	this.x=function(n){
		if(n==undefined)return this._x;
		if(n instanceof Amount){
			this._x.bind(n);
			return this;
			}
		this._x.value(n);
		return this;
		};
	this.y=function(n){
		if(n==undefined)return this._y;
		if(n instanceof Amount){
			this._y.bind(n);
			return this;
			}
		this._y.value(n);
		return this;
		};
	}
Clicker.prototype=new Layer();